package com.wicket.okrfinance.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrfinance.biz.service.dto.req.*;
import com.wicket.okrfinance.biz.service.dto.res.*;
import com.wicket.okrfinance.common.exception.BizException;
import com.wicket.okrfinance.common.util.CommonFunctionHelper;
import com.wicket.okrfinance.common.util.RedisUtil;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wicket.okrfinance.common.exception.Assert;
import com.wicket.okrfinance.biz.service.FinanceService;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class TargetContentServiceImpl
  implements com.wicket.okrfinance.biz.service.TargetContentService {

  @Resource
  private RedisUtil redisUtil;
@Resource
  private FinanceService financeService;
/**
   * D3执行目标内容账户加减(公共)[7700]
   * gen by moon at 11/8/2023, 1:26:07 AM
   */
  @Trace(operationName = "D3执行目标内容账户加减(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ImplementTargetContentAccountAddOrSubtractComRespDto implementTargetContentAccountAddOrSubtractCom(ImplementTargetContentAccountAddOrSubtractComReqDto reqDto){
    
      
      //virtualUsage D3-查询上级账户详情(公共)  51977
//      QuerySuperiorsFinanceAccountDetailComRespDto querySuperiorsFinanceAccountDetailComRespDto = null;
//    Object querySuperiorsFinanceAccountDetailComReqDto=new Object();
//  querySuperiorsFinanceAccountDetailComReqDto.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1243449_1_51977
//querySuperiorsFinanceAccountDetailComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:1243448_1_51977
//if(reqDto!=null){
//      querySuperiorsFinanceAccountDetailComReqDto.setIsBudgetAccount(reqDto.getIsBudgetAccount());//SimpleFieldAssign//sourceId:1243446_1_51977
//querySuperiorsFinanceAccountDetailComReqDto.setAccountObjectld(reqDto.getAccountObjectld());//SimpleFieldAssign//sourceId:1243445_1_51977
//querySuperiorsFinanceAccountDetailComReqDto.setAccountObjectClass(reqDto.getAccountObjectClass());//SimpleFieldAssign//sourceId:1243443_1_51977
//querySuperiorsFinanceAccountDetailComReqDto.setEvaluationTemplateId(reqDto.getEvaluationTemplateId());//SimpleFieldAssign//sourceId:1243444_1_51977
//    }
//
//    /*D3-查询上级账户详情(公共)[7680]   */
//    Assert.isNull(querySuperiorsFinanceAccountDetailComReqDto.getIsBudgetAccount(),"D3执行目标内容账户加减(公共)-D3-查询上级账户详情(公共)-是否预算账户不能为空",false);
//Assert.isNull(querySuperiorsFinanceAccountDetailComReqDto.getAccountObjectld(),"D3执行目标内容账户加减(公共)-D3-查询上级账户详情(公共)-关联归属主体ID不能为空",false);
//Assert.isNull(querySuperiorsFinanceAccountDetailComReqDto.getAccountObjectClass(),"D3执行目标内容账户加减(公共)-D3-查询上级账户详情(公共)-账户关联主体类型不能为空",false);
//Assert.isNull(querySuperiorsFinanceAccountDetailComReqDto.getEvaluationTemplateId(),"D3执行目标内容账户加减(公共)-D3-查询上级账户详情(公共)-冗余评价模板ID不能为空",false);
//Assert.isNull(querySuperiorsFinanceAccountDetailComReqDto.getSubjectLifeCycle(),"D3执行目标内容账户加减(公共)-D3-查询上级账户详情(公共)-主体生命周期不能为空",false);
//Assert.isNull(querySuperiorsFinanceAccountDetailComReqDto.getSpaceId(),"D3执行目标内容账户加减(公共)-D3-查询上级账户详情(公共)-创建于空间ID不能为空",false);
//      querySuperiorsFinanceAccountDetailComRespDto = appFinanceService.querySuperiorsFinanceAccountDetailCom(querySuperiorsFinanceAccountDetailComReqDto)/*vcase invoke 跨dubbo调用;*/;
//
//
      
//virtualUsage D7执行初始化账户(公共)  51910
//      ImplementInitializeFinanceAccountComRespDto implementInitializeFinanceAccountComRespDto = null;
//    if(querySuperiorsFinanceAccountDetailComRespDto !=null){
//          ImplementInitializeFinanceAccountComReqDto implementInitializeFinanceAccountComReqDto=new ImplementInitializeFinanceAccountComReqDto();
//  implementInitializeFinanceAccountComReqDto.setCertificationStatus("AUTHENTICATED");//sourceId:1240209_1_51910
//implementInitializeFinanceAccountComReqDto.setAccountTypeCode("ECOLOGICAL_ACCOUNT");//sourceId:1240210_1_51910
//implementInitializeFinanceAccountComReqDto.setEcologicalAccountTypeCode("TARGET_CONTENT_ACCOUNT");//sourceId:1240212_1_51910
//implementInitializeFinanceAccountComReqDto.setDistributionSystemTypeCode("CAPITAL_SYSTEM");//sourceId:1240217_1_51910
//implementInitializeFinanceAccountComReqDto.setSubjectLifeCycle("CURRENTLY_VALID");//sourceId:1240219_1_51910
//implementInitializeFinanceAccountComReqDto.setSpaceId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecSpaceId());//CURRENT_SPACEID//sourceId:1240221_1_51910
//implementInitializeFinanceAccountComReqDto.setAppId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecAppId());//CURRENT_APPID//sourceId:1240222_1_51910
//if(reqDto!=null){
//      implementInitializeFinanceAccountComReqDto.setAccountCode(reqDto.getCurrentContentCode());//SimpleFieldAssign//sourceId:1240208_1_51910
//implementInitializeFinanceAccountComReqDto.setIsBudgetAccount(reqDto.getIsBudgetAccount());//SimpleFieldAssign//sourceId:1240211_1_51910
//implementInitializeFinanceAccountComReqDto.setAccountObjectClass(reqDto.getAccountObjectClass());//SimpleFieldAssign//sourceId:1240213_1_51910
//implementInitializeFinanceAccountComReqDto.setAccountObjectTypeCode(reqDto.getAccountObjectTypeCode());//SimpleFieldAssign//sourceId:1240215_1_51910
//implementInitializeFinanceAccountComReqDto.setAccountObjectld(reqDto.getAccountObjectld());//SimpleFieldAssign//sourceId:1240214_1_51910
//implementInitializeFinanceAccountComReqDto.setAccountContentCode(reqDto.getCurrentContentCode());//SimpleFieldAssign//sourceId:1240216_1_51910
//implementInitializeFinanceAccountComReqDto.setIsOrgOfficialAccountNom(reqDto.getIsOrgOfficialAccountNom());//SimpleFieldAssign//sourceId:1240218_1_51910
//    }
//if(querySuperiorsFinanceAccountDetailComRespDto!=null){
//      implementInitializeFinanceAccountComReqDto.setParentAccountId(querySuperiorsFinanceAccountDetailComRespDto);//SimpleFieldAssign//sourceId:1243453_1_51910
//    }
//
//    /*D7执行初始化账户(公共)[7678]   */
//    Assert.isNull(implementInitializeFinanceAccountComReqDto.getAccountCode(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-账户标识不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getCertificationStatus(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-认证状态不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getAccountTypeCode(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-账户类型不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getIsBudgetAccount(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-是否预算账户不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getEcologicalAccountTypeCode(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-生态账户类型编码不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getAccountObjectClass(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-账户关联主体类型不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getAccountObjectTypeCode(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-关联归属主体类型编码不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getAccountObjectld(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-关联归属主体ID不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getAccountContentCode(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-冗余账户归属内容标识不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getDistributionSystemTypeCode(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-发行体系类型编码不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getIsOrgOfficialAccountNom(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-是否组织正式财务标准不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getSubjectLifeCycle(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-主体生命周期不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getSpaceId(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-创建于空间ID不能为空",false);
//Assert.isNull(implementInitializeFinanceAccountComReqDto.getAppId(),"D3执行目标内容账户加减(公共)-D7执行初始化账户(公共)-创建于联盟应用ID不能为空",false);
//      implementInitializeFinanceAccountComRespDto = financeService.implementInitializeFinanceAccountCom(implementInitializeFinanceAccountComReqDto)/*vcase invoke isSameApp*/;
//
//
//
//           }
////virtualUsage D7执行账户资金处理(公共)  51913
//      ImplementAccountFundHandleComRespDto implementAccountFundHandleComRespDto = null;
//    if(implementInitializeFinanceAccountComRespDto !=null){
//          ImplementAccountFundHandleComReqDto implementAccountFundHandleComReqDto=new ImplementAccountFundHandleComReqDto();
//  implementAccountFundHandleComReqDto.setIsOriginBill("FALSE");//sourceId:1240227_1_51913
//implementAccountFundHandleComReqDto.setIsButtFinance("FALSE");//sourceId:1242016_1_51913
//implementAccountFundHandleComReqDto.setBillMethod("TALLY");//sourceId:1240239_1_51913
//implementAccountFundHandleComReqDto.setBillStatus("COMPLETE");//sourceId:1240244_1_51913
//if(implementInitializeFinanceAccountComRespDto!=null){
//      implementAccountFundHandleComReqDto.setAccountId(implementInitializeFinanceAccountComRespDto.getAccountId());//SimpleFieldAssign//sourceId:1240225_1_51913
//    }
//if(reqDto!=null){
//      implementAccountFundHandleComReqDto.setBillAmount(reqDto.getBillAmount());//SimpleFieldAssign//sourceId:1240226_1_51913
//implementAccountFundHandleComReqDto.setBillTypeCode(reqDto.getBillTypeCode());//SimpleFieldAssign//sourceId:1240224_1_51913
//implementAccountFundHandleComReqDto.setAccountOptType(reqDto.getAccountOptType());//SimpleFieldAssign//sourceId:1240250_1_51913
//implementAccountFundHandleComReqDto.setBillBizStory(reqDto.getBillBizStory());//SimpleFieldAssign//sourceId:1240229_1_51913
//implementAccountFundHandleComReqDto.setOppositeLogo(reqDto.getOppositeLogo());//SimpleFieldAssign//sourceId:1240234_1_51913
//implementAccountFundHandleComReqDto.setOppositeName(reqDto.getOppositeName());//SimpleFieldAssign//sourceId:1240235_1_51913
//implementAccountFundHandleComReqDto.setBizBillObjectTypeCode(reqDto.getAccountObjectTypeCode());//SimpleFieldAssign//sourceId:1240744_1_51913
//implementAccountFundHandleComReqDto.setBizBillObjectId(reqDto.getAccountObjectld());//SimpleFieldAssign//sourceId:1240743_1_51913
//implementAccountFundHandleComReqDto.setContnetAccountSubjectld(reqDto.getContnetAccountSubjectld());//SimpleFieldAssign//sourceId:1240748_1_51913
//implementAccountFundHandleComReqDto.setCapitalSourceId(reqDto.getCapitalSourceId());//SimpleFieldAssign//sourceId:1240248_1_51913
//    }
//
//    /*D7执行账户资金处理(公共)[7687]   */
//    Assert.isNull(implementAccountFundHandleComReqDto.getAccountId(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-账户ID不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getBillAmount(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-账单金额不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getAccountOptType(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-账户操作类型不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getIsOriginBill(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-是否发生方账单不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getIsButtFinance(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-是否对接财务不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getBillBizStory(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-流水业务故事信息不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getOppositeLogo(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-对方logo不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getOppositeName(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-对方名称不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getBillMethod(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-收支方式不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getBizBillObjectTypeCode(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-关联业务单据对象类型不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getBizBillObjectId(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-关联业务单据对象ID不能为空",false);
//Assert.isNull(implementAccountFundHandleComReqDto.getBillStatus(),"D3执行目标内容账户加减(公共)-D7执行账户资金处理(公共)-账单状态不能为空",false);
//      implementAccountFundHandleComRespDto = financeService.implementAccountFundHandleCom(implementAccountFundHandleComReqDto)/*vcase invoke isSameApp*/;
//
//
//
//           }
ImplementTargetContentAccountAddOrSubtractComRespDto retData = new ImplementTargetContentAccountAddOrSubtractComRespDto();
  
  

  
  
return retData;
  }
  //
}
